package com.zhu.oj.mapper;

import com.zhu.oj.model.dto.question.QuestionWithSubmitDTO;
import com.zhu.oj.model.entity.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author HANG
* @description 针对表【question(题目)】的数据库操作Mapper
* @createDate 2025-04-27 15:34:06
* @Entity com.yupi.oj.model.entity.Question
*/
public interface QuestionMapper extends BaseMapper<Question> {

    /**
     * 查询题目及其用户提交状态
     * @param userId 用户ID
     * @param questionId 题目ID（可选，传null查询所有）
     * @return 题目和提交状态信息列表
     */
    List<QuestionWithSubmitDTO> selectQuestionWithSubmitStatus(@Param("userId") Long userId, 
                                                               @Param("questionId") Long questionId);


}




